package com.erp.erp_servers.warehouse.imp;

import com.erp.erp_dao.warehouse.IWarehouseLogDao;
import com.erp.erp_entitys.warehouse.entity.WarehouseLogEntity;
import com.erp.erp_servers.warehouse.IWarehouseLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : WarehouseLogServiceImp
 * @Description : 仓库操作日志实现类
 * @Author : lst
 * @Date: 2020-11-05 21:30
 */
@Service
public class WarehouseLogServiceImp implements IWarehouseLogService {

    /**
     * 注入仓库操作日志mapper
     */
    private final IWarehouseLogDao warehouseLogDao;

    @Autowired
    public WarehouseLogServiceImp(IWarehouseLogDao warehouseLogDao) {
        this.warehouseLogDao = warehouseLogDao;
    }

    /**
     * 通过实体作为筛选条件查询
     *
     * @param warehouseLog 实例对象
     * @return 对象列表
     */
    @Override
    public List<WarehouseLogEntity> queryAll(WarehouseLogEntity warehouseLog) {
        return warehouseLogDao.queryAll(warehouseLog);
    }

    /**
     * 新增数据
     *
     * @param warehouseLog 实例对象
     * @return 影响行数
     */
    @Override
    public int insert(WarehouseLogEntity warehouseLog) {
        return warehouseLogDao.insert(warehouseLog);
    }
}
